﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"
    Inherits="System_Domain_List" CodeFile="Domain_List.aspx.cs" %>

<%@ Register Src="~/UserControl/GridPager.ascx" TagName="GridPager" TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <title>域维护</title>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <script type="text/javascript">
        $(function () {
            var dlg = $('#dd').dialog({
                title: '域列表编辑',
                iconCls: 'icon-ok',
                closed: true,
                buttons: [{
                    text: '保存',
                    handler: function () {
                        $get('<%=btnSave.ClientID %>').click();
                    }
                }, {
                    text: '返回',
                    handler: function () {
                        $('#dd').dialog('close');
                    }
                }]
            });
            dlg.parent().appendTo(jQuery("form:first"));
            var dlg_div;
            dialogDiv(dlg_div);
        });
        function open1() {
            $('#dd').dialog('open');
        }
        function dialogDiv(dlg) {
            dlg = $('#Div1').dialog({
                title: '域数据复制',
                iconCls: 'icon-ok',
                closed: true,
                buttons: [{
                    text: '复制',
                    handler: function () {
                        $get('<%=but_Copy.ClientID %>').click();
                    }
                }, {
                    text: '返回',
                    handler: function () {
                        $('#Div1').dialog('close');
                    }
                }]
            });
            dlg.parent().appendTo(jQuery("form:first"));
        }
        function open2() {
            $('#Div1').dialog('open');
        }

    </script>
    <asp:ScriptManagerProxy ID="ScriptManagerProxy1" runat="server">
    </asp:ScriptManagerProxy>
    <asp:UpdatePanel UpdateMode="Conditional" ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <input id="txtID" runat="server" type="hidden" />
            <table id="wsd_inputtable">
                <tr>
                    <td class="tabletitle" style="height: 21px" width="100%">
                        域列表
                    </td>
                </tr>
            </table>
            <table id="wsd_listtable">
                <tr>
                    <td>
                        <div style="height: 370px; overflow: scroll">
                            <asp:GridView Width="100%" ID="GridView1" DataKeyNames="ID" runat="server" AutoGenerateColumns="False"
                                BorderWidth="0" OnRowDataBound="Grid_RowDataBound" EmptyDataText="没有可显示的数据."
                                EmptyDataRowStyle-Font-Bold="true" EmptyDataRowStyle-HorizontalAlign="Center"
                                EnableEmptyContentRender="true" OnSelectedIndexChanged="GridView1_SelectedIndexChanged"
                                AllowPaging="True" OnPageIndexChanging="GridView1_PageIndexChanging" PageSize="15"
                                EnableModelValidation="True">
                                <HeaderStyle CssClass="titlist" />
                                <EmptyDataRowStyle HorizontalAlign="Center" Font-Bold="True"></EmptyDataRowStyle>
                                <Columns>
                                   
                                    <asp:TemplateField HeaderText="域名称" ItemStyle-HorizontalAlign="Center" ShowHeader="False"
                                        ItemStyle-Width="15%">
                                        <ItemTemplate>
                                            <asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="false" CommandName="Select"
                                                Text='<%# Eval("SYS_NAME") %>' OnClientClick="open1()"></asp:LinkButton>
                                        </ItemTemplate>
                                        <ControlStyle Font-Underline="False" />
                                    </asp:TemplateField>
                                      
                                           <asp:BoundField HeaderText="地址"  DataField="SYSTEMADDITIONALINFO1" ItemStyle-HorizontalAlign="Center" ShowHeader="False"
                                        />
                                           <asp:BoundField HeaderText="联系人"  DataField="SYSTEMADDITIONALINFO3" ItemStyle-HorizontalAlign="Center" ShowHeader="False"
                                       />
                                          <asp:BoundField HeaderText="联系方式"  DataField="SYSTEMADDITIONALINFO2" ItemStyle-HorizontalAlign="Center" ShowHeader="False"
                                       />
                                    <asp:BoundField HeaderText="管理员账号" DataField="ADMINCODE" ItemStyle-HorizontalAlign="Center" ShowHeader="False"
                                       />
                                       
                                    <asp:TemplateField HeaderText="创建时间" ItemStyle-HorizontalAlign="Center" ShowHeader="False"
                                        ItemStyle-Width="15%">
                                        <ItemTemplate>
                                            <%# Jumpton.SFA.Server.BusinessRule.BusinessLogic.GetDateTime(Eval("CREATE_TIME").ToString(),"yyyyMMddHHmmss","yyyy-MM-dd HH:mm:ss") %>
                                        </ItemTemplate>
                                        <ControlStyle Font-Underline="False" />
                                    </asp:TemplateField>
                                    <%--<asp:BoundField HeaderText="修改人"  DataField="CODE2" ItemStyle-HorizontalAlign="Center" ShowHeader="False"
                                        ItemStyle-Width="15%"/>
                                       
                                    <asp:TemplateField HeaderText="修改时间" ItemStyle-HorizontalAlign="Center" ShowHeader="False"
                                        ItemStyle-Width="15%">
                                        <ItemTemplate>
                                            <%# Jumpton.SFA.Server.BusinessRule.BusinessLogic.GetDateTime(Eval("LAST_UPDATE_TIME").ToString(), "yyyyMMddHHmmss", "yyyy-MM-dd HH:mm:ss")%>
                                        </ItemTemplate>
                                        <ControlStyle Font-Underline="False" />
                                    </asp:TemplateField>--%>
                                    <asp:TemplateField HeaderText="有效">
                                        <ItemTemplate>
                                            <b>
                                                <%# (bool)Eval("ACTIVE") ? "<font size='3' color='green'>√</font>" : "<font size='3' color='red'>×</font>"%>
                                            </b>
                                        </ItemTemplate>
                                        <HeaderStyle HorizontalAlign="Center" />
                                        <ItemStyle HorizontalAlign="Center" />
                                    </asp:TemplateField>
                                </Columns>
                                <PagerSettings Visible="false" FirstPageText="首页" LastPageText="尾页" Mode="NumericFirstLast"
                                    PageButtonCount="30" />
                                <RowStyle CssClass="evenline" />
                                <AlternatingRowStyle CssClass="oddline" />
                            </asp:GridView>
                            <uc1:GridPager ID="GridPager1" runat="server" />
                        </div>
                    </td>
                </tr>
            </table>
            <table id="wsd_inputtable">
                <tr>
                    <td width="100%" class="tabletitle">
                        操作选项
                    </td>
                </tr>
                <tr>
                    <td class="buttonarea">
                        <asp:Button ID="Button1" runat="server" class="wsd_button2" Text="新  增" OnClick="Button1_Click"
                            OnClientClick="open1();" CausesValidation="false" />&nbsp;&nbsp;
                        <asp:Button ID="Button2" runat="server" class="wsd_button2" Text="复  制" OnClientClick="open2();"
                            CausesValidation="false" />
                    </td>
                </tr>
            </table>
        </ContentTemplate>
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="btnSave" EventName="Click" />
        </Triggers>
    </asp:UpdatePanel>
    <div id="dd" icon="icon-save" style="width: 415px; height: 395px; text-align: center;">
        <asp:UpdatePanel UpdateMode="Conditional" ID="UpdatePanel2" runat="server">
            <ContentTemplate>
                <table id="wsd_inputtable" style="width: 100%; height: 100%;">
                    <tr>
                        <td>
                            <center>
                                <asp:DetailsView CssClass="wsd_inputtable" ID="DetailsView1" runat="server" AutoGenerateRows="False"
                                    DataSourceID="ObjectDataSource1" DefaultMode="Insert" BorderStyle="Dotted" BorderWidth="0px"
                                    OnDataBound="DetailsView1_DataBound" GridLines="None" EnableModelValidation="True">
                                    <Fields>
                                        <asp:TemplateField ControlStyle-CssClass="tabletitle">
                                            <ItemTemplate>
                                                <font color="red" size="2"><b>提示:*为必填项</b></font>
                                            </ItemTemplate>
                                            <ControlStyle CssClass="tabletitle"></ControlStyle>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="<font color=red>*</font>域代码:">
                                            <ItemTemplate>
                                                <asp:TextBox ID="txtDomainID" runat="server" MaxLength="10" Text='<%# Bind("CODE") %>'></asp:TextBox><span
                                                    class="keyword"></span>
                                                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtDomainID"
                                                    Display="Dynamic" ErrorMessage="域代码不能为空"></asp:RequiredFieldValidator>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="<font color=red>*</font>域名称:">
                                            <ItemTemplate>
                                                <asp:TextBox ID="txtSysName" runat="server" MaxLength="20" Text='<%# Bind("SysName") %>'></asp:TextBox><span
                                                    class="keyword"></span>
                                                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtSysName"
                                                    ErrorMessage="域名称不能为空"></asp:RequiredFieldValidator>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                         <asp:TemplateField HeaderText="地址:">
                                            <ItemTemplate>
                                                <asp:TextBox ID="txtSYSTEM_ADDITIONAL_INFO1" runat="server" MaxLength="40" Text='<%# Bind("SYSTEMADDITIONALINFO1") %>'></asp:TextBox><span
                                                    class="keyword"></span>
                                               
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                          <asp:TemplateField HeaderText="联系人:">
                                            <ItemTemplate>
                                                <asp:TextBox ID="txtSYSTEM_ADDITIONAL_INFO3" runat="server" MaxLength="40" Text='<%# Bind("SYSTEMADDITIONALINFO3") %>'></asp:TextBox><span
                                                    class="keyword"></span>
                                               
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                         <asp:TemplateField HeaderText="联系方式:">
                                            <ItemTemplate>
                                                <asp:TextBox ID="txtSYSTEM_ADDITIONAL_INFO2" runat="server" MaxLength="40" Text='<%# Bind("SYSTEMADDITIONALINFO2") %>'></asp:TextBox><span
                                                    class="keyword"></span>
                                               
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                         
                                         <asp:TemplateField HeaderText="备注:">
                                            <ItemTemplate>
                                                <asp:TextBox ID="txtSYSTEM_ADDITIONAL_INFO4" runat="server" Rows=3 TextMode="MultiLine"  MaxLength="200" Text='<%# Bind("SYSTEMADDITIONALINFO4") %>'></asp:TextBox><span
                                                    class="keyword"></span>
                                               
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="有效:">
                                            <ItemTemplate>
                                                <asp:CheckBox runat="server" ID="chkValid" Checked='<%# Eval("ACTIVE")==null?false:Eval("ACTIVE").ToString().ToUpper() == "TRUE" %>' />
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                    </Fields>
                                    <RowStyle CssClass="tablefield" />
                                </asp:DetailsView>
                                <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" DataObjectTypeName="Jumpton.SFA.Server.Entity.DOMAINS"
                                    InsertMethod="Save" SelectMethod="Load" TypeName="Jumpton.SFA.Server.BusinessRule.System.DomainManager"
                                    UpdateMethod="Update">
                                    <SelectParameters>
                                        <asp:ControlParameter Name="domainID" DefaultValue="14" ControlID="GridView1" Type="Decimal"
                                            PropertyName="SelectedValue" />
                                    </SelectParameters>
                                </asp:ObjectDataSource>
                            </center>
                        </td>
                    </tr>
                </table>
                <div style="display: none">
                    <asp:Button ID="btnSave" runat="server" class="wsd_button2" Text="保  存" OnClick="btnSave_Click" />&nbsp;&nbsp;
                </div>
            </ContentTemplate>
            <Triggers>
                <asp:AsyncPostBackTrigger ControlID="Button1" EventName="Click" />
                <asp:AsyncPostBackTrigger ControlID="GridView1" EventName="SelectedIndexChanged" />
            </Triggers>
        </asp:UpdatePanel>
    </div>
    <div id="Div1" icon="icon-save" style="width: 415px; height: 250px; text-align: center;" modal="true">
        <asp:UpdatePanel UpdateMode="Conditional" ID="UpdatePanel3" runat="server">
            <ContentTemplate>
                <table id="Table1" style="width: 100%;">
                    <tr>
                        <td style="width: 50%; font-weight: bold;">
                            选择源数据
                        </td>
                        <td style="width: 50%; font-weight: bold;">
                            选择目标
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:ListBox ID="ListBox1" runat="server" Width="100%" Height="156" DataSourceID="ObjectDataSource2"
                                DataTextField="SYSNAME" DataValueField="ID"></asp:ListBox>
                        </td>
                        <td>
                            <asp:ListBox ID="ListBox2" runat="server" Width="100%" Height="156" DataSourceID="ObjectDataSource2"
                                DataTextField="SYSNAME" DataValueField="ID"></asp:ListBox>
                        </td>
                    </tr>
                </table>
                <asp:ObjectDataSource ID="ObjectDataSource2" runat="server" DataObjectTypeName="Jumpton.SFA.Server.Entity.DOMAINS"
                    SelectMethod="Load" TypeName="Jumpton.SFA.Server.BusinessRule.System.DomainManager">
                </asp:ObjectDataSource>
                <div style="display: none">
                    <asp:Button ID="but_Copy" runat="server" class="wsd_button2" Text="复制数据" OnClick="but_Copy_Click"
                        CausesValidation="false" />&nbsp;&nbsp;
                </div>
            </ContentTemplate>
            <Triggers>
                <asp:AsyncPostBackTrigger ControlID="Button2" EventName="Click" />
            </Triggers>
        </asp:UpdatePanel>
    </div>
</asp:Content>
